
//---------------------------------------------------
// TABLE 2: Future Lobbyists and Legislative Activity
//---------------------------------------------------

****** HOUSE ******

clear
use masterdata_house.dta

gen ln_meansalary = ln(meansalary +1)
gen nolobstaff = numstaff - futurelob
gen femaleratio = numfemale/numstaff

gen lnles = ln(les+1)
gen lntotbill = ln(totbill+1)
gen lnssbill = ln(ss_bills +1)

macro define member_char1 "majority dwnom1 budget chair subchr seniority maj_leader min_leader power dem membecamelob female afam latino state_leg south_dem"
macro define member_char2 "majority dwnom1 budget chair subchr seniority maj_leader min_leader power"
macro define staff_char1 "ln_meansalary nolobstaff futurelob cstaff_lob femaleratio"


* main regression 

eststo clear
eststo: quietly reg lnles      $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly reg lntotbill  $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly reg lnssbill   $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly areg lnles     $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
eststo: quietly areg lntotbill $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
eststo: quietly areg lnssbill  $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
esttab, star(* 0.10 ** 0.05 *** 0.01)  drop(*congress*) se ar2 


* substantive effects 

areg lnles i.congress, a(icpsr) vce(cluster icpsr)
predict temp, residuals 



****** SENATE ******

clear
use masterdata_senate.dta

gen ln_meansalary = ln(meansalary +1)
gen nolobstaff = numstaff - futurelob
gen femaleratio = numfemale/numstaff

gen lnles = ln(les+1)
gen lntotbill = ln(totbill+1)
gen lntotimpbill = ln(totimpbill +1)

gen dem =0
replace dem = 1 if party =="D"
replace dem = 1 if party =="I"

gen female = minwomen + majwomen

macro define member_char1 "majority dwnom1 chair subchr seniority maj_leader min_leader power up_for_reelection freshman dem membecamelob afam latino south_dem female state_leg house_service house_les"
macro define member_char2 "majority dwnom1 chair subchr seniority maj_leader min_leader power up_for_reelection freshman"
macro define staff_char1 "ln_meansalary nolobstaff futurelob cstaff_lob femaleratio "

* main regression 

eststo clear
eststo: quietly reg  lnles        $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly reg  lntotbill    $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly reg  lntotimpbill $staff_char1 $member_char1 i.congress, vce(cluster icpsr)
eststo: quietly areg lnles        $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
eststo: quietly areg lntotbill    $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
eststo: quietly areg lntotimpbill $staff_char1 $member_char2 i.congress, a(icpsr) vce(cluster icpsr)
esttab, star(* 0.10 ** 0.05 *** 0.01)  drop(*congress*) se ar2


